<?php
/*
 * [insert-quote]
 * 
 * @author: Blagovest Gospodinov
 */

class Core_Utility_ArrayKeys{
	const KEY_ERROR_TEMPLATE = 'Invalid key: %s';
	
	static public function isValid($key){
		return is_string( $key ) or is_int( $key );	
	}
	
	static public function assertIsValid($key){
		if( self::isValid($key) == false )
			throw new Core_Exception_Registry_KeyError( sprintf( self::KEY_ERROR_TEMPLATE , $key ) );
	}
}